using UnityEngine;

public class btnShowShadow : MonoBehaviour
{
	public GameObject ButtonEnabled;

	public GameObject ButtonDisabled;

	public void OnClickEnable()
	{
		Enable(true);
		ButtonEnabled.SetActive(true);
		ButtonDisabled.SetActive(false);
	}

	private void Enable(bool val)
	{
		Save.SaveBool(settings.keyEnableShadow, val);
		BCWShadow[] array = Object.FindObjectsOfType<BCWShadow>();
		BCWShadow[] array2 = array;
		foreach (BCWShadow bCWShadow in array2)
		{
			bCWShadow.enabled = val;
		}
	}

	public void OnClickDisabled()
	{
		Enable(false);
		ButtonEnabled.SetActive(false);
		ButtonDisabled.SetActive(true);
	}

	private void OnEnable()
	{
		if (Load.LoadBool(settings.keyEnableShadow))
		{
			ButtonEnabled.SetActive(true);
			ButtonDisabled.SetActive(false);
		}
		else
		{
			ButtonEnabled.SetActive(false);
			ButtonDisabled.SetActive(true);
		}
	}
}
